home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr50 / vbmdixpl.zip / FLOATING.FRM < prev    next >
Text File  |  1993-05-17  |  4KB  |  148 lines

  1. VERSION 2.00
  2. Begin Form FloatingToolbar 
  3.    BorderStyle     =   1  'Fixed Single
  4.    Height          =   2364
  5.    Left            =   6888
  6.    LinkTopic       =   "Form2"
  7.    MaxButton       =   0   'False
  8.    MinButton       =   0   'False
  9.    ScaleHeight     =   1944
  10.    ScaleWidth      =   972
  11.    Top             =   4800
  12.    Width           =   1068
  13.    Begin PictureBox SampleIcon 
  14.       DragMode        =   1  'Automatic
  15.       Height          =   492
  16.       Index           =   7
  17.       Left            =   480
  18.       Picture         =   FLOATING.FRX:0000
  19.       ScaleHeight     =   468
  20.       ScaleWidth      =   468
  21.       TabIndex        =   7
  22.       Top             =   1440
  23.       Width           =   492
  24.    End
  25.    Begin PictureBox SampleIcon 
  26.       DragMode        =   1  'Automatic
  27.       Height          =   492
  28.       Index           =   6
  29.       Left            =   0
  30.       Picture         =   FLOATING.FRX:0302
  31.       ScaleHeight     =   468
  32.       ScaleWidth      =   468
  33.       TabIndex        =   6
  34.       Top             =   1440
  35.       Width           =   492
  36.    End
  37.    Begin PictureBox SampleIcon 
  38.       DragMode        =   1  'Automatic
  39.       Height          =   492
  40.       Index           =   5
  41.       Left            =   480
  42.       Picture         =   FLOATING.FRX:0604
  43.       ScaleHeight     =   468
  44.       ScaleWidth      =   468
  45.       TabIndex        =   5
  46.       Top             =   960
  47.       Width           =   492
  48.    End
  49.    Begin PictureBox SampleIcon 
  50.       DragMode        =   1  'Automatic
  51.       Height          =   492
  52.       Index           =   4
  53.       Left            =   0
  54.       Picture         =   FLOATING.FRX:0906
  55.       ScaleHeight     =   468
  56.       ScaleWidth      =   468
  57.       TabIndex        =   4
  58.       Top             =   960
  59.       Width           =   492
  60.    End
  61.    Begin PictureBox SampleIcon 
  62.       DragMode        =   1  'Automatic
  63.       Height          =   492
  64.       Index           =   3
  65.       Left            =   480
  66.       Picture         =   FLOATING.FRX:0C08
  67.       ScaleHeight     =   468
  68.       ScaleWidth      =   468
  69.       TabIndex        =   3
  70.       Top             =   480
  71.       Width           =   492
  72.    End
  73.    Begin PictureBox SampleIcon 
  74.       DragMode        =   1  'Automatic
  75.       Height          =   492
  76.       Index           =   0
  77.       Left            =   0
  78.       Picture         =   FLOATING.FRX:0F0A
  79.       ScaleHeight     =   468
  80.       ScaleWidth      =   468
  81.       TabIndex        =   2
  82.       Top             =   0
  83.       Width           =   492
  84.    End
  85.    Begin PictureBox SampleIcon 
  86.       DragMode        =   1  'Automatic
  87.       Height          =   492
  88.       Index           =   2
  89.       Left            =   0
  90.       Picture         =   FLOATING.FRX:120C
  91.       ScaleHeight     =   468
  92.       ScaleWidth      =   468
  93.       TabIndex        =   1
  94.       Top             =   480
  95.       Width           =   492
  96.    End
  97.    Begin PictureBox SampleIcon 
  98.       DragMode        =   1  'Automatic
  99.       Height          =   492
  100.       Index           =   1
  101.       Left            =   480
  102.       Picture         =   FLOATING.FRX:150E
  103.       ScaleHeight     =   468
  104.       ScaleWidth      =   468
  105.       TabIndex        =   0
  106.       Top             =   0
  107.       Width           =   492
  108.    End
  109. End
  110. Declare Function SetWindowPos Lib "user" (ByVal h%, ByVal hb%, ByVal x%, ByVal y%, ByVal cx%, ByVal cy%, ByVal f%) As Integer
  111.  
  112. Sub Form_Load ()
  113.  
  114.  
  115.  
  116. Const SWP_NOMOVE = 2
  117. Const SWP_NOSIZE = 1
  118. Const FLAGS = SWP_NOMOVE Or SWP_NOSIZE
  119. Const HWND_TOPMOST = -1
  120. Const HWND_NOTOPMOST = -2
  121.  
  122. ' To set the form XXXX to TOPMOST, use the following code:
  123.  
  124. success% = SetWindowPos(Me.hWnd, HWND_TOPMOST, 0, 0, 0, 0, FLAGS)
  125.      'success% <> 0 When Successful
  126.  
  127. ' size the Toolbar:
  128.  
  129.   FloatingToolbar.Width = SampleIcon(1).Width * 2
  130.   FloatingToolbar.Height = SampleIcon(1).Height * 4 + 300 'empiric for the Titlebar
  131.  
  132. ' load the Drag Icons
  133. For i = 0 To 7
  134.  SampleIcon(i).DragIcon = SampleIcon(i).Picture
  135. Next
  136.  
  137. End Sub
  138.  
  139. Sub Form_QueryUnload (cancel As Integer, UnloadMode As Integer)
  140.  ' Fake an unload
  141.  cancel = 1 ' dont unload
  142.  Me.Visible = False ' but become invisble
  143.  ' reset the Menu-Option
  144.  MDIForm1.M_FloatingToolbar.Checked = False
  145.  
  146. End Sub
  147.  
  148.